package com.tricode.ile.training.task.sl275.lab7;

/**
 * @author student
 */
public class Account {
    private double balance;

    public Account() { }

    /**
     * Creates a new instance of Account
     */
    public Account(double initBalance) {
        balance = initBalance;
    }

    public double getBalance() {
        return balance;
    }

    public boolean deposit(double amt) {
        balance = balance + amt;
        return true;
    }

    public boolean withdraw(double amt) {
        if (balance >= amt) {
            balance = balance - amt;
            return true;
        } else {
            return false;
        }
    }
}